ramfandomcom-20200214-history
Modding Tutorials/Fire Geometry and Hitpoints
=Intro= It is EXTREMELY easy to get TOTALLY CHAOTIC damage results if you don't build your fire geometry and hitpoint (spheres) according to some very specific rules. =The Rules= All Fire Geometry # Find Component all FG! ## Non-component'ed FG is ignored by the game by both the penetration and damage simulations. # Convex Shell it all (required to get correct-facing normals). Just creating it inside Oxygen is not enough as only the Convex Shell command will yield correct normals. ## Otherwise: some angles faces of your fire geometry will ignore damage effects. # Avoid overlapping the geometry if possible ## It may cause geometry to be missed by the penetration simulation, making your armor inaccurate; although it does not seem to do much harm to the damage simulation. # Assign it a desired Material RVMAT (shortcut "e"), you don't/shouldn't give it a Texture. If the fire geometry is armor # Keep hitpoint spheres out of it as much as possible. ## Otherwise: partial penetration of armor will cause significant damage to the vehicle. If the fire geometry is a damageable component # The geometry should be encased as evenly as possible within a shell of hitpoint spheres. Damage is much more predictable if the spheres are "poking out" of the FG. ## You don't want giant spheres impinging on other geometry however, so it's best to use more spheres with a smaller radius. ## You generally don't want spheres in just part of your FG piece--unless you are trying to treat the un-sphered section as armor. ## Spheres inside FG and irregularly spaced: you will get inconsistent damage based on what angle and location you hit the FG at. Hitpoint Vertices/Spheres # Do NOT multi-assign hitpoint vertices; a vertex should belong to only one named selection. # Avoid overlapping hitpoint spheres from different groups (e.g. Hull & Turret). ## It will not wreck things, but damage will end up going to both components to an extent you may not intend. Crew Proxies # Crew proxies must be included in the FG LOD--the same proxies as in the visual LOD's. ## Otherwise: crew cannot be damaged ## Note that the crew damage model may be simplified and apparently limited in the crew's animation config: boundingSphere (the default value of 1.0 possibly being too small to properly encompass the crew properly). Bugs # The CfgVehicles property viewGunnerInExternal / viewDriverInExternal is bugged and does not work for the driver of a vehicle, which apparently prevents this crew position from taking damage when buttoned up. # Crew appear to ignore indirectHit damage and respond only to direct hits (and "hit" damage). =Visual Guide= The diagram above shows 3 different methods of assigning hitpoint spheres to fire geometry ("FG"). The red FG represents an area you want to receive damage, while the blue FG represents armor that should not cause damage when hit. The purple circles represent hitpoint spheres (P3D vertices with radii defined by hitpoint class config file). * A''' is the recommended way to handle FG. The damage FG consists of separate geometry encased in hitpoint spheres. Whenever the damage FG is hit, it will receive consistent, predictable damage. * '''B is not ideal but can still work. It is not as predictable in its damage results as "A". In this case, the area without hitpoint spheres is intended to function as armor--receiving minimal/no damage. The rest of the geometry is encased in hitpoint spheres as in "A". * C''' is ''not''' an acceptable approach. It combines several problems, and hits on geometry like this will produce very inconsistent damage results: ** the damage FG is not fully encased in spheres ** the spheres are not evenly placed within the FG ** several of the spheres are submerged inside the FG =How Damage Works= * Significant damage is caused when a projectile penetrates ''both hitpoint sphere(s) and fire geometry. * No damage is caused if fire geometry is not penetrated. * Minor damage is caused when fire geometry is penetrated even if no hitpoint sphere(s) are penetrated. Formula for Hit Damage (damage taken in %) = hit / armor * hit = "hit" value from cfgAmmo * armor = ** Global damage: cfgVehicles global "armor" value ** Local ('hitpoint' location) damage: armor value = global "armor" value x class "armor" coefficient * Remember: cfgVehicles "armorStructural" value acts as a divisor to global damage: global damage = damage / armorStructural Formula for indirectHit Damage * Direct damage: same as hit above ** i.e. (damage taken in %) = iHit / armor * Indirect damage: falls off to 4x indirectHitRange Weapons Combining Hit and indirectHit * Direct damage: uses whichever property is larger, the two values are not added together * Indirect damage: same as indirectHit above ** i.e. it is based on indirectHit value only (hit value does not affect it).